<div class="row" style="margin-top: 1em">
  <div class="col-sm-1">
    <button class="btn btn-default btn-block" ui-sref="lesson.callname.show({callnameId:currentCallnameId})">返回</button>
  </div>

  <div class="col-sm-8">
    <p class="text-primary lead"> {{currentList.name}} <small>({{ filterName }})</small> </p>
  </div>

</div>

<div class="row" ng-hide="students.length">

  <p class="text-center text-info lead">
    当前列表没有任何学生
  </p>

</div>

<div class="row" ng-show="students.length">

  <div class="col-sm-8">
    <callname-box students="students" status="status" mode="callnameMode" marked-students="markedStudents" handler="handler"></callname-box>
  </div>

  <div class="col-sm-4">

    <div class="row">
      <div class="col-sm-12">
        <form class="form-horizontal" role="form">

          <div class="form-group">
            <label class="col-sm-4 control-label">点名模式</label>
            <div class="col-sm-6">
              <select ng-model="callnameMode"  class="form-control" ng-options="mode.value as mode.label for mode in modes"></select>
            </div>
          </div>

        </form>
      </div>


    </div>

    <div class="row">
      <div class="col-sm-offset-2 col-sm-8">
        <button class="btn btn-block btn-primary"
                ng-click="handler.start()"
                ng-disabled="status == 'doing' "
            >
          开始点名
        </button>
      </div>
    </div>

    <div class="row">
      <div class="col-sm-offset-2 col-sm-8">
        <button class="btn btn-block btn-warning" style="margin-top: 0.7em" ng-disabled="status != 'doing' " ng-hide="callnameMode == 'auto'" ng-click="handler.pause()">暂停并选择</button>
      </div>
    </div>

    <div class="row">
      <div class="col-sm-offset-2 col-sm-8">
        <button class="btn btn-block btn-warning" style="margin-top: 0.7em" ng-disabled="status != 'doing' "  ng-show="callnameMode == 'auto'" ng-click="handler.pause()">停止本次</button>
      </div>
    </div>

    <div class="row">
      <div class="col-sm-offset-2 col-sm-8">
        <button class="btn btn-block btn-danger" style="margin-top: 0.7em" ng-disabled="status != 'doing'" ng-click="handler.reset()">重置点名</button>
      </div>
    </div>

    <div class="row" style="margin-top: 1em" ng-show="markedStudents.length">

      <div class="col-sm-offset-2 col-sm-8">
        <button class="btn btn-info btn-block" ng-click="save()">将此记录保存</button>
      </div>

      <div class="col-sm-12">
        <table class="table table-hover">

          <thead>
          <tr>
            <th>学号</th>
            <th>姓名</th>
            <th>结果</th>
          </tr>

          </thead>
          <tbody>
          <tr ng-repeat="markStudent in markedStudents"
              ng-click="selected(markStudent)"
              ng-class="{'danger': markStudent.mark == 'absent', 'success':markStudent.mark != 'absent'}">
            <td>{{ markStudent.number}}</td>
            <td>{{ markStudent.name }}</td>
            <td>
              <span ng-show="markStudent.mark == 'absent'">缺勤</span>
              <span ng-hide="markStudent.mark == 'absent'">出勤</span>
            </td>
          </tr>
          </tbody>
        </table>
      </div>
    </div>

  </div>


</div>